Skip to content

Fix search preview editor mime type on JDK 27#9522

Merged
ebarboni merged 1 commit into
apache:deliveryfrom
mbien:fix-search-preview-mime-type-on-jdk27
Jul 22, 2026
Merged

Fix search preview editor mime type on JDK 27#9522
ebarboni merged 1 commit into
apache:deliveryfrom
mbien:fix-search-preview-mime-type-on-jdk27

Conversation

@mbien

@mbien mbien commented Jul 17, 2026

Copy link
Copy Markdown
Member

mime types can't be set by String atm since the mime type injection hack doesn't work anymore. Set it by editor kit, similar other code does it (previews in bookmarks view, refactoring view. diffs etc - they all still work on JDK 27).

repro: use right click search and/or replace and look at preview, the editor should not be plain text

edit: this is for delivery, we can cleanup AppContext usages for NB 32 #9523

@mbien mbien added this to the NB31 milestone Jul 17, 2026
@mbien mbien added Editor ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Jul 17, 2026
mime types can't be set by String atm since the mime type injection
hack doesn't work anymore. Set it by editor kit, similar other code
does it (previews in bookmarks view, refactoring view. diffs etc).
@mbien
mbien force-pushed the fix-search-preview-mime-type-on-jdk27 branch from 974ee23 to f5aa6ef Compare July 17, 2026 10:55

@neilcsmith-net neilcsmith-net left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

Comment on lines 147 to 151
initAndCheckEditorKitTypeRegistry("application/rtf", RTFEditorKit.class.getName()); //NOI18N

// Now hook up to the JDK's editor kit registry
// XXX: This all should be removed, see IZ #80110
try {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment should probably also be copied to around here:

Suggested change
initAndCheckEditorKitTypeRegistry("application/rtf", RTFEditorKit.class.getName()); //NOI18N
// TODO AppContext and kitRegistryKey don't exist anymore in JDK 27+
// Now hook up to the JDK's editor kit registry
// XXX: This all should be removed, see IZ #80110
try {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah you are right. i have put it on the uninstall code instead of the install code. But i think its fine we have to go through all AppContext usages anyway and get rid of them.

Comment on lines 177 to 183
// for (int i = 0; i < replacements.length; i++) {
// JEditorPane.registerEditorKitForContentType(
// replacements[i].contentType,
// replacements[i].newKitClassName,
// getClass().getClassLoader()
// );
// }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the official and only JDK‑supported code path for JDK 27+.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ExE-Boss yes, it's also (as commented at #9523 (comment) ) not enough to replace what the current code is doing. We will have to come up with a registration strategy, or decide whether to remove this ability to pass in content types as a mime String to use NetBeans' editor kits. Personally, I think we might just mark this feature deprecated in the release notes for NB31.

@ebarboni
ebarboni merged commit 4e75559 into apache:delivery Jul 22, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants